package cn.yr.clock.service;

import cn.yr.clock.domain.entity.Record;
import cn.yr.common.exception.ret.Ret;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Date;

/**
 * @author Lang
 * @email 1102076808@qq.com
 * @date 2021-09-25 11:13:41
 */
public interface RecordService extends IService<Record> {

    void addRecord(Record record);


    /**
     * 打卡
     *
     * @param record
     * @return
     */
    Ret<Object> clock(Record record, Long userId, Date clockTime);

    Ret<Object> supplementClock(Record record, Long userId, Date clockTime);

    /**
     * 获取最后打卡记录
     *
     * @param userId
     * @return
     */
    Record getLastRecord(Long userId);


    Integer sumRecordByUserId(Long userId);

    Boolean hasRecordToday(Long userId, Date date);

    Integer selectContinuous(Long userId);
}

